package com.pure.common.factory;

import com.pure.common.enums.PriceType;
import lombok.Data;

import java.util.Objects;

@Data
public class AffectedPriceSpec implements Cloneable {
    private String channel;

    private String saleType;

    private String sellerDivision;

//    private String materialNo;

    private String sapMaterialNo;

//    private String materialName;

//    private String buyerName;

    private String sellerName;

//    private String sellerNo;

    private String province;

    private String city;

    private String district;

    private String terminal;

    private String company;

    private PriceType priceType;

    private String unit;

    private String paymentMethod;

    private String deliveryMethod = "";

    private String customerLevel = "";

//    private String discount = "";

    private String discountType = "";

    private Long accountNo;


    @Override
    public boolean equals(Object o) {
        AffectedPriceSpec that = (AffectedPriceSpec) o;
        return true
                && Objects.equals(this.getChannel(), that.getChannel())
                && Objects.equals(this.getSaleType(), that.getSaleType())
                && Objects.equals(this.getSellerDivision(), that.getSellerDivision())
//                && Objects.equals(this.getMaterialNo(), that.getMaterialNo())
                && Objects.equals(this.getSapMaterialNo(), that.getSapMaterialNo())
//                && Objects.equals(this.getMaterialName(), that.getMaterialName())
//                && Objects.equals(this.getBuyerName(), that.getBuyerName())
                && Objects.equals(this.getProvince(), that.getProvince())
                && Objects.equals(this.getCity(), that.getCity())
                && Objects.equals(this.getDistrict(), that.getDistrict())
                && Objects.equals(this.getTerminal(), that.getTerminal())
                && Objects.equals(this.getCompany(), that.getCompany())
                && Objects.equals(this.getPriceType(), that.getPriceType())
                && Objects.equals(this.getUnit(), that.getUnit())
                && Objects.equals(this.getPaymentMethod(), that.getPaymentMethod())
                && Objects.equals(this.getDeliveryMethod(), that.getDeliveryMethod())
                && Objects.equals(this.getCustomerLevel(), that.getCustomerLevel())
//                && Objects.equals(this.getDiscount(), that.getDiscount())
                && Objects.equals(this.getDiscountType(), that.getDiscountType())
                ;
    }

    @Override
    public int hashCode() {
        return Objects.hash(
                getChannel(),
                getSaleType(),
                getSellerDivision(),
//                getMaterialNo(),
                getSapMaterialNo(),
//                getMaterialName(),
//                getBuyerName(),
                getProvince(),
                getCity(),
                getDistrict(),
                getTerminal(),
                getCompany(),
                getPriceType(),
                getUnit(),
                getPaymentMethod(),
                getDeliveryMethod(),
                getCustomerLevel(),
//                getDiscount(),
                getDiscountType()
        );
    }

    @Override
    public AffectedPriceSpec clone() throws CloneNotSupportedException {
        AffectedPriceSpec copy = (AffectedPriceSpec) super.clone();

        return copy;
    }
}
